import { camelize, toHandlerKey } from "../shared/index";

export function emit(instance, event, ...args) {
    const { props } = instance;

    // TPP开发技巧
    // 先写一个特定行为 =》 重构成递用的行为

    const handlerName = toHandlerKey(camelize(event));
    const handler = props[handlerName];
    handler && handler(...args);
}